﻿<UserControl x:Class="UCL.Powersource.Views.PowersourceMainView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:vs="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.11.0"
             Background="{DynamicResource {x:Static vs:VsBrushes.ToolWindowBackgroundKey}}"
             Foreground="{DynamicResource {x:Static vs:VsBrushes.WindowTextKey}}"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300"
             Name="MainView">
    <UserControl.Resources>
        <ResourceDictionary >
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="VSLikeStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>


    </UserControl.Resources>
    <Grid>
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup Name="ConnectionStates">
                <VisualState Name="Disconnected">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="IsTFSConnected_Not" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame Value="{x:Static Visibility.Visible}"></DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState Name="Connected">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="IsTFSConnected" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame Value="{x:Static Visibility.Visible}"></DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>


        <StackPanel Orientation="Horizontal" Name="IsTFSConnected_Not" Height="20" Visibility="Collapsed">
            <TextBlock>Not connected</TextBlock>
            <Button Name="TryTFSConnect">Connect</Button>
        </StackPanel>

        <Border Name="IsTFSConnected" Visibility="Collapsed">
            <StackPanel Orientation="Vertical">
                <TextBlock Name="Title" Margin="10" HorizontalAlignment="Center"></TextBlock>
                <TextBlock Name="CollectionTitle" Margin="10" HorizontalAlignment="Center"/>
                <!--<TextBlock Name="Title" Margin="10" HorizontalAlignment="Center"></TextBlock>-->
                <!--<Button Content="_Click Me!" Click="button1_Click" Width="120" Height="80" Name="button1"/>-->
                <DataGrid Name="CurrentTfsTeamProjectConfigurations" HeadersVisibility="Column" AutoGenerateColumns="False" >
                    <DataGrid.Columns>
                        <DataGridCheckBoxColumn Binding="{Binding Path=IsChosen}" Header="Include"/>
                        <DataGridTextColumn Binding="{Binding Path=UniqueName}" Header="Team Name"/>
                        <DataGridTextColumn Binding="{Binding Path=MemberNamesString}" Header="Members"/>
                    </DataGrid.Columns>
                </DataGrid>
                <Grid HorizontalAlignment="Stretch" Background="{DynamicResource {x:Static vs:VsBrushes.CommandBarMenuBackgroundGradientKey}}" >
                <StackPanel Orientation="Horizontal" Margin="5,5" HorizontalAlignment="Center" >
                    <Button Name="RefreshCurrentTfsTeamProjectCollectionConfiguration" Content="REFRESH CONNECTION" Style="{StaticResource DefaultButtonStylePowersource}"/>
                    <Button Name="OpenReporting" Content="OPEN REPORTING" Style="{StaticResource DefaultButtonStylePowersource}"/>
                    <Button Name="OpenSettings" Content="SETTINGS" Style="{StaticResource DefaultButtonStylePowersource}"/>
                    <Button Name="ComputeStatisticsForExport" Style="{StaticResource DefaultButtonStylePowersource}">COMPUTE STATISTICS FOR EXPORT</Button>
                    <Button Name="ExportToExcel" Style="{StaticResource DefaultButtonStylePowersource}">EXPORT TO XLS</Button>
                </StackPanel>
                </Grid>
            </StackPanel>
        </Border>
    </Grid>
</UserControl>
